summaryrefslogtreecommitdiff
path: root/src/pages/blogs/[...slug].astro
blob: 3b15fc79fa22d73077a7f25fd78cdf79fac5da7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
import { getCollection } from "astro:content";
import Blog from "@layouts/Blog.astro";
import Markdown from "@components/Markdown.astro";
import Terminal from "@layouts/Terminal.astro";
import BlogItem from "@components/BlogItem.astro";

export async function getStaticPaths() {
    const blogEntries = await getCollection("blogs");
    return blogEntries.map((entry) => ({
        params: { slug: entry.slug },
        props: { entry },
    }));
}

const { entry } = Astro.props;
const { Content } = await entry.render();
---

<Terminal path="blogs/">
    <div class="w-full h-[65vh] overflow-y-auto pr-4">
        <div class="flex flex-col h-full m-0 p-0">
            <BlogItem
                title={entry.data.title}
                description={entry.data.description ?? ""}
                date={entry.data.date}
            />
            <div class="text-[130%] flex-grow">
                <Content />
            </div>
        </div>
    </div>
</Terminal>

<!-- <Blog title=`/home/kyren/blogs/${entry.slug}`> -->
<!--     <Content /> -->
<!-- </Blog> -->